class ProfileController < ApplicationController
  include AuthenticatedSystem

  before_filter :login_required

  def edit
    @user = User.find(current_user.id)
  end

  def update
    @user = User.find(current_user.id)
    params[:user].delete("is_admin")
    if @user.update_attributes(params[:user])
      flash[:notice] = 'Profile was successfully updated.'
      redirect_to :action => 'edit', :id => @user
    else
      render :action => 'edit'
    end
  end

end
